package br.com.android.financas.adapter;

import java.io.File;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class FileAdapter extends ArrayAdapter<File> {

	private Activity activity;

	public FileAdapter(Context context, int resource, File[] objects) {
		super(context, resource, objects);
		this.activity=(Activity) context;
	}


	public View getView(int position, View convertView, ViewGroup parent) {
		LayoutInflater inflater = activity.getLayoutInflater();
		View row = inflater.inflate(android.R.layout.simple_spinner_item, parent, false);
		TextView item = (TextView) row.findViewById(android.R.id.text1);
		File file=getItem(position);
		item.setText(file.getName());
		return row;
	}
}
